#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
@Author: kindey
@Date: 2025/8/5
@Description: 
"""
from .base import *

# 开发环境专用配置
DEBUG = False

ALLOWED_HOSTS = ['localhost', '127.0.0.1']
# Password validation
# https://docs.djangoproject.com/en/4.2/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
    {
        'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
    },
]

# 开发环境使用SQLite数据库
DATABASE_ROUTERS = ['config.db_routers.DatabaseRouter']
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': BASE_DIR / 'db.sqlite3',
    },
    'source': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': BASE_DIR / '火石咀煤矿(2024.12.30).db',
    },
    'result': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': BASE_DIR / 'custom.db',
    }
}

# 静态文件配置
STATIC_URL = '/static/'
STATIC_ROOT = BASE_DIR / 'staticfiles'  # 收集静态文件的目录

# 额外的静态文件目录
STATICFILES_DIRS = [
    BASE_DIR / 'static',           # 项目根目录下的static文件夹
    BASE_DIR / 'assets',           # 项目根目录下的assets文件夹
    BASE_DIR / 'apps' / 'static',  # apps目录下的static文件夹
]

# 媒体文件配置
MEDIA_URL = '/media/'
MEDIA_ROOT = BASE_DIR / 'media'

# 生产环境邮件后端（控制台输出）
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'

# 详细的日志输出
LOGGING = {
    'version': 1,
    'disable_existing_loggers': True,
    'handlers': {
        'console': {
            'class': 'logging.StreamHandler',
        },
    },
    'root': {
        'handlers': ['console'],
        'level': 'INFO',
    },
}